package pl.matt.hibernate;

import org.hibernate.impl.SessionFactoryImpl;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.FileSystemXmlApplicationContext;

public class SessionFactoryProvider {

 public org.hibernate.impl.SessionFactoryImpl getSessionFactoryImpl() {
  try {
   ApplicationContext ac = new FileSystemXmlApplicationContext("//home/mateusz/priv/workspace/mgr/resources/application-context.xml");
   SessionFactoryImpl out = (SessionFactoryImpl) ac.getBean("sessionFactory");
   return out;
  } catch (Exception e) {
   e.printStackTrace();
  }
  return null;
 }
 
}